﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Example13.aspx.cs" Inherits="Chapter26.Example13" %>

<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>代码清单 26-13 合并进行链式搜索</title>
    <meta name="author" content="Adam Freeman" />
    <meta name="description" content="A simple example" />
    <link rel="shortuct icon" href="favicon.ico" type="image/x-icon" />
    <style>
        pre {
            border: medium double black;
        }
    </style>
</head>
<body>
    <pre id="results"></pre>
    <p id="tblock">
        There are lots of different kinds of fruit - there are you over 500 
        varieties of <span id="banana">banana</span> alone. By the time we add the 
        countless types of <span id="apple">apples</span>, 
        <span id="orange">oranges</span>, and other well-known fruit, we are 
        faced with thousands of choices.
    </p>
    <script>
        var resultsElement = document.getElementById("results");

        var elems = document.getElementById("tblock").getElementsByTagName("span");
        resultsElement.innerHTML += "The are " + elems.length + " span elements\n";

        var elems2 = document.getElementById("tblock").querySelectorAll("span");
        resultsElement.innerHTML += "The are " + elems2.length + " span elements (Mix)\n";

        var selElems = document.querySelectorAll("#tblock > span");
        resultsElement.innerHTML += "The are " + selElems.length + " span elements (CSS)\n";
    </script>
</body>
</html>
